<template>
  <view>
    <view class="special-work-list__item">
      <text class="special-work-list__label">动火地点：</text>
      <text class="special-work-list__value">{{ detail.workLocation }}</text>
    </view>
    <view class="special-work-list__item">
      <text class="special-work-list__label">动火作业级别：</text>
      <text class="special-work-list__value">{{ detail.workLevelLabel }}</text>
    </view>
    <view class="special-work-list__item">
      <text class="special-work-list__label">动火方式：</text>
      <text class="special-work-list__value">{{ workPatternLabel }}</text>
    </view>
    <view class="special-work-list__item">
      <text class="special-work-list__label">动火作业负责人：</text>
      <text class="special-work-list__value">{{ detail.principalLabel }}</text>
    </view>
    <view class="special-work-list__item">
      <text class="special-work-list__label">动火实施时间：</text>
      <text class="special-work-list__value">
        {{ actualDateLabel }}
      </text>
    </view>
    <view class="special-work-list__item">
      <text class="special-work-list__label">危害介质：</text>
      <text class="special-work-list__value">{{ ticket.hazardMediaLibList }}</text>
    </view>
    <view class="special-work-list__item flex-col">
      <text class="special-work-list__label">动火人</text>
      <view class="flex-table mb-20">
        <view class="flex-table__tr" v-for="(item, index) in detail.workCertificates" :key="index">
          <view class="flex-table__td" style="width: 200rpx">{{ item.name }}</view>
          <view class="flex-table__td flex-auto">{{ item.qualityNumber }}</view>
        </view>
      </view>
    </view>
  </view>
</template>

<script>
export default {
  props: {
    detail: {
      type: Object,
      default: () => ({})
    },
    ticket: {
      type: Object,
      default: () => ({})
    },
    inspect: {
      type: Object,
      default: () => ({})
    },
    actualDateLabel: String
  },
  computed: {
    workPatternLabel() {
      if (!this.detail.workPattern) {
        return ''
      }
      const workPattern = []
      this.detail.workPattern.forEach((item) => {
        workPattern.push(item.label)
      })
      if (this.detail.otherWorkPattern) {
        workPattern.push(this.detail.otherWorkPattern)
      }
      return workPattern.join('，')
    }
  }
}
</script>

<style scoped lang="scss">
@import '../style/style.scss';
</style>
